﻿<?php
	include_once '../../conn/mysql.php';
	if(isset($_GET['id'])){
		$id=$_GET["id"];
		$res=sql("s", "list", "*", "where id=".$id);
		$info=firstrow($res);
		$res1=sql("s", "product", "*", "where id=".gv($info,'sp_id'));
		$info1=firstrow($res1);
		$res2=sql("s", "user", "*", "where user='".gv($info,'tjr')."'");
		$info2=firstrow($res2);
	}else{
		$info='';
	}
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../templates/met/images/css/reset.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../templates/met/images/css/metinfo.css" />
<script type="text/javascript"src="../include/metvar.js"></script>
<script type="text/javascript" src="../include/metinfo.js"></script>
<script type="text/javascript" src="../../public/js/metinfo-min.js"></script>
<script type="text/javascript" src="../templates/met/images/js/iframes.js"></script>
<script type="text/javascript" src="../templates/met/images/js/cookie.js"></script>
<style type="text/css">
body{
	font-size: ; 
	font-family:;
	text-align:center;
}
</style>
<script type="text/javascript">
//ajax执行时间
var time=200;
var lang = 'cn';
var metimgurl='../templates/met/images/';
</script>
<script type="text/javascript">
	$(document).keypress(function(e){  
	var type = e.keyCode||e.which||e.charCode;
		if(type==27){ 		
			parent.sitemp('set/sitemap.php?lang=cn&admintp=&langset=cn');  
		}				
	});
</script>

<link rel="stylesheet" href="../../editor/themes/default/default.css" />
	<link rel="stylesheet" href="../../editor/plugins/code/prettify.css" />
	<script charset="utf-8" src="../../editor/kindeditor.js"></script>
	<script charset="utf-8" src="../../editor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="../../editor/plugins/code/prettify.js"></script>
<script>

		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : '../../editor/plugins/code/prettify.css',
				uploadJson : '../../editor/php/upload_json.php',
				fileManagerJson : '.../../editor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
<title>添加内容</title>
<script language = 'JavaScript'>
var onecount;
subcat = new Array();
onecount=0;
function Checkimg(){ 
if (document.myform.title.value==null || document.myform.title.value.length == 0) {
	alert(user_msg['js13']);
	document.myform.title.focus();
	return false;
}
if (document.myform.class2.value =='0') {
	alert(user_msg['js14']);
	document.myform.class2.focus();
	return false;
}
}</script>
<script>
var num=1;
function tianjia(){
	
	var name=document.getElementById("suk").innerHTML;
	num=num+1;

	var htmc=name+'<table  width="450"  cellspacing="0" border="0"><tr ><td  width="149"><input name="suk'+num+'" border="0px" style="padding:4px" type="text" size="20"  value="" /></td><td  width="64"><input name="cb'+num+'" border="0px" style="padding:4px" type="text" size="8" value="" /></td><td  width="64"><input name="jg'+num+'" border="0px" style="padding:4px" type="text" size="8" value="" /></td><td  width="64"><input name="fc'+num+'" border="0px" style="padding:4px" type="text" size="8" value="" /></td><td  width="47"></td><td ></td></tr></table>';
	document.getElementById("suk").innerHTML=htmc;
	document.getElementById("num").value=num;
		//	var section=document.getElementById("section").value;
			//var job=document.getElementById("job").value;
	//		var tel=document.getElementById("tel").value;
		//	var ji=document.getElementById("ji").value;
	//		document.getElementById("yibu").src="yibu.php?oper=add&name="+name+"&section="+section+"&job="+job+"&tel="+tel+"&ji="+ji;
	}
</script>
</head>
<body>

	
<table cellpadding="2" cellspacing="1" class="table">
          <tr> 
            <td colspan="3" class="title">订单详情</td>
          </tr>		  
 <tr> 
            <td class="text">订单信息</td>
            <td colspan="2" class="input"> 订单ID：<?=gv($info,'id');?>， 下单时间：<?=gv($info,'time');?> ， 推荐人：<?=gv($info,'tjr');?></td>
          </tr>
		  <tr> 
            <td class="text">购买商品</td>
            <td colspan="2" class="input"> <?=gv($info,'spm');?>　<?=gv($info,'suk');?>，　<?=gv($info,'jg');?> 元<br>
商户：<?=gv($info1,'sh');?> ， 联系QQ：<?=gv($info1,'qq');?></td>
          </tr>

          <tr> 
            <td class="text">收货信息</td>
            <td colspan="2" class="input">姓名： <?=gv($info,'shr');?>， <?=gv($info,'tel');?> ，<?=gv($info, "dz").gv($info,'xdz');?></td>
          </tr>
          <tr> 
            <td class="text">推荐人信息</td>
            <td colspan="2" class="input"> <?=gv($info2,'xingming');?>， <?=gv($info2,'zhifubao');?> ，<?=gv($info, "fc");?></td>
          </tr>
     <?php
	 if(gv($info,"zt")=="1"){
	 
	 ?>
 <form  method="POST" name="myform" action="../control.php?oper=fahuo&id=<?=$id;?>" target="_self">
          
           <tr> 
            <td class="text"><font class="must">*</font>快递名称</td>
            <td colspan="2" class="input"> 
                <select name="kd" id="select">
  <option <?php if(gv($info,"kd")=="圆通"){echo 'selected="selected"';}?> value="圆通">圆通</option>
  <option <?php if(gv($info,"kd")=="顺丰"){echo 'selected="selected"';}?> value="顺丰">顺丰</option>
  <option <?php if(gv($info,"kd")=="全峰"){echo 'selected="selected"';}?> value="金峰">全峰</option>
  <option <?php if(gv($info,"kd")=="汇通"){echo 'selected="selected"';}?> value="圆通">汇通</option>
  <option <?php if(gv($info,"kd")=="天天"){echo 'selected="selected"';}?> value="顺丰">天天</option>
  <option <?php if(gv($info,"kd")=="EMS"){echo 'selected="selected"';}?> value="金峰">EMS</option>
</select>
            </td>
          </tr>
 			<tr> 
            <td class="text">快递单号</td>
            <td colspan="2" class="input"><input name="dh" type="text" class="text" value="<?=gv($info,"dh");?>">
         
            </td>
          </tr>
		<tr> 
            <td class="text">备注信息</td>
            <td colspan="2" class="input"><input name="beizhu" type="text" class="text" value="<?=gv($info,"beizhu");?>"></td>
          </tr>
		
		

		  <tr> 
            <td class="text"></td>
	      <td class="submit"><input type="submit" name="Submit" value="发货" class="submit" onclick="return Smit($(this),'myform')" /><input type="reset" name="Submit" value="重置" class="reset" /> </td>
          </tr>
          
          </form>
          
   <?php
	 }elseif(gv($info,"zt")=="2"){
   ?>       
   
  <tr> 
            <td class="text">快递信息</td>
            <td colspan="2" class="input"> 订单已发货： <?=gv($info,"kd");?> /  <?=gv($info,"dh");?> ， <a href='http://m.kuaidi100.com/index_all.html?type=<?=$pkd;?>&postid=<?=gv($info,"dh");?>#result'>点击查询</a><br>
 物流更新：： <?=gv($info,"fh_time");?> 商户已发货 </td>
          </tr>
           <tr> 
            <td class="text"></td>
              
	      <td class="submit">
          <table width="99%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th width="50px" scope="col"><form  method="POST" name="myform" action="../control.php?oper=jiesuan&id=<?=$id;?>" target="_self"><input type="submit" name="Submit" value="确认已签收" class="submit" onclick="return Smit($(this),'myform')" /></form></th>
    <th width="50px" scope="col"><form  method="POST" name="myform" action="../control.php?oper=jushou&id=<?=$id;?>" target="_self"><input type="submit" name="Submit" value="拒收" class="submit" onclick="return Smit($(this),'myform')" /></form></th>
    <th >&nbsp;</th>
  </tr>
</table>

          </td>
          </tr>
          
    <?php
	 }elseif(gv($info,"zt")=="3"){
		 include '../../pinyin.php';
		 $pkd=pinyin(gv($info,"kd"),'gb2312');
   ?>       
   
    <tr> 
            <td class="text">快递信息</td>
            <td colspan="2" class="input"> 订单已发货： <?=gv($info,"kd");?> /  <?=gv($info,"dh");?> ， <a href='http://m.kuaidi100.com/index_all.html?type=<?=$pkd;?>&postid=<?=gv($info,"dh");?>#result'>点击查询</a><br>
 物流更新：： <?=gv($info,"fh_time");?> 商户已发货 </td>
          </tr>
          <tr> 
            <td class="text">备注信息</td>
            <td colspan="2" class="input"><form  method="POST" name="myform" action="../control.php?oper=edit_bei&id=<?=$id;?>" target="_self"><input name="beizhu" type="text" class="text" value="<?=gv($info,"beizhu");?>"><br><input type="submit" value="修改" /></form> </td>
          </tr>
           <tr> 
            <td class="text"></td>
            <td colspan="2" class="input"><form  method="POST" name="myform" action="../control.php?oper=fankuan&id=<?=$id;?>" target="_self"><input type="submit" name="Submit" value="返款" class="submit" onclick="return Smit($(this),'myform')" /></form> </td>
          </tr>

          
    <?php
	 }elseif(gv($info,"zt")=="4"){
	 ?>
     <form  method="POST" name="myform" action="../control.php?oper=tuihuo&id=<?=$id;?>" target="_self">
          
           <tr> 
            <td class="text"><font class="must">*</font>收件人</td>
            <td colspan="2" class="input"> <input name="th_name" type="text" class="text nonull"  value="<?=gv($info,"th_name");?>"></td>
          </tr>
           <tr> 
            <td class="text"><font class="must">*</font>电话</td>
            <td colspan="2" class="input"> <input name="th_tel" type="text" class="text nonull"  value="<?=gv($info,"th_tel");?>"></td>
          </tr>
 			<tr> 
            <td class="text">地址</td>
            <td colspan="2" class="input"><input name="th_dz" type="text" class="text" value="<?=gv($info,"th_dz");?>"></td>
          </tr>
		
		

		  <tr> 
            <td class="text"></td>
	      <td class="submit"><input type="submit" name="Submit" value="同意退货" class="submit" onclick="return Smit($(this),'myform')" /><input type="reset" name="Submit" value="重置" class="reset" /> </td>
          </tr>
          
          </form> 
     <?php
	 }elseif(gv($info,"zt")=="5"){
	 ?>
   
          
           <tr> 
            <td class="text">收件人</td>
            <td colspan="2" class="input"> <?=gv($info,"th_name");?></td>
          </tr>
           <tr> 
            <td class="text">电话</td>
            <td colspan="2" class="input"> <?=gv($info,"th_tel");?></td>
          </tr>
 			<tr> 
            <td class="text">地址</td>
            <td colspan="2" class="input"><?=gv($info,"th_dz");?></td>
          </tr>
		
		

		  <tr> 
            <td class="text"></td>
              <form  method="POST" name="myform" action="../control.php?oper=wanchengtuihuo&id=<?=$id;?>" target="_self">
	      <td class="submit"><input type="submit" name="Submit" value="已完成退货" class="submit" onclick="return Smit($(this),'myform')" /></td> </form> 
          </tr>
          
         
     <?php
	 }elseif(gv($info,"zt")=="6"){
		$res=sql("s", "yichang", "*", "where list_id=".$id);
		$info=firstrow($res);
	 ?>
   
          
           <tr> 
            <td class="text">退款金额</td>
            <td colspan="2" class="input"> <?=gv($info,"money");?></td>
          </tr>
           <tr> 
            <td class="text">退款说明</td>
            <td colspan="2" class="input"> <?=gv($info,"sm");?></td>
          </tr>
 			<tr> 
            <td class="text">退还佣金</td>
            <td colspan="2" class="input"><?=gv($info,"yongjin");?></td>
          </tr>
		<tr> 
            <td class="text">备注信息</td>
            <td colspan="2" class="input"><?=gv($info,"beizhu");?> </td>
          </tr>
	
          
         
     <?php
	 }elseif(gv($info,"zt")=="8"){
	 ?>
     <tr> 
            <td class="text">备注信息</td>
            <td colspan="2" class="input"><?=gv($info,"beizhu");?> </td>
          </tr>
   <form  method="POST" name="myform" action="../control.php?oper=tuikuan&id=<?=$id;?>" target="_self">
          
           <tr> 
            <td class="text">返款金额</td>
            <td colspan="2" class="input"> <input name="money" type="text" class="text" value=""></td>
          </tr>
           <tr> 
            <td class="text">返款说明</td>
            <td colspan="2" class="input"> <input name="sm" type="text" class="text" value=""></td>
          </tr>
          <tr> 
            <td class="text">清算佣金</td>
            <td colspan="2" class="input"> <input name="yongjin" type="text" class="text" value=""></td>
          </tr>
  <tr> 
            <td class="text"></td>
	      <td class="submit"><input type="submit" name="Submit" value="退款" class="submit" onclick="return Smit($(this),'myform')" /> </td>
          </tr>
          
          </form> 
		
	
          
         
     <?php
	 }
	 ?>      
		<tr>
		  <td class="footer" colspan="2"> </td>
	  </tr>
</table>        

</body>
</html>
